package com.example.yangyifei_android_the_third;

import android.app.Activity;
import android.view.View;
import android.widget.TextView;
public class myclicklistener implements View.OnClickListener {


    private Activity mActivity;
    private TextView te;
    public myclicklistener(Activity activity,TextView nte){
        this.mActivity=activity;
        this.te=nte;
    }
    public void onClick(View v) {
        switch(v.getId()){
            case R.id.button5:
                te.setText("点击了使用外部类作为监听器");
                break;
        }
        }
    }

